package com.sso.login.controller;

import com.sso.login.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

import java.util.Set;

@Controller
public class LoginController {
    private static Set<User> dbUsers;
    static {
        dbUsers.add(new User(0,"zhangsan","123456"));
        dbUsers.add(new User(1,"lisi","123456"));
        dbUsers.add(new User(0,"wangwu","123456"));
    }
    public String doLogin(User user,HttpSession session){
        String target = (String) session.getAttribute("target");
        //重定向到target地址
        return "redirect:"+target;
    }
}
